<?php if (!defined('THINK_PATH')) exit();?><div class="modal-dialog">
	<div class="modal-content">
		<form role="form" id="addForm" method="post" action="<?php echo U('menu/edit');?>">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title">修改菜单</h4>
			</div>
			<div class="modal-body">
				<input type="hidden" name="id" value="<?php echo ($id); ?>" />
				<div class="form-group">
					<label for="name">菜单名称</label>
					<input type="text" class="form-control" id="name" name="name" value="<?php echo ($name); ?>">
				</div>
				<div class="form-group">
					<label for="href">链接地址</label>
					<input type="text" class="form-control" id="href" name="href" value="<?php echo ($href); ?>">
				</div>
				<div class="form-group">
					<label for="pid">父菜单</label>
					<select name="pid" id="pid" class="form-control">
						<option value="0">一级菜单</option>
						<?php echo ($treeList); ?>
					</select>
				</div>
				<div class="form-group">
					<label for="pid">权限认证</label>
					<select name="auth" id="auth" class="form-control">
						<option value="1" <?php if(($auth) == "1"): ?>selected<?php endif; ?> >是</option>
						<option value="0" <?php if(($auth) == "0"): ?>selected<?php endif; ?> >否</option>
					</select>
				</div>
				<div class="form-group">
					<label for="icon">图标</label>
					<div class="input-group">
						<input type="text" class="form-control" id="icon" name="icon" value="<?php echo ($icon); ?>">
						<span class="input-group-btn">
							<a class=" btn btn-default copy ajax-load " href="<?php echo U('menu/icon');?>">选择图标</a>
						</span>
					</div>
				</div>

			</div>
			<div class="modal-footer">
				<button type="submit" class="btn btn-danger">保 存</button>
			</div>
		</form>
	</div>
	<script src="/Public/assets/js/validation/bootstrapValidator.js" type="text/javascript" charset="utf-8"></script>

	<script type="text/javascript">
		$("#addForm").bootstrapValidator({              
	    	                excluded: [':disabled'],
	    	                feedbackIcons: {
	    	                    valid: 'glyphicon glyphicon-ok',
	    	                    invalid: 'glyphicon glyphicon-remove',
	    	                    validating: 'glyphicon glyphicon-refresh'
	    	                },
	    	                submitHandler: function (validator, form, submitButton) {
	    	                   validator.defaultSubmit();
	    	                },
	    	                fields: {
	    	                    name: {
	    	                        validators: {
	    	                            notEmpty: {
	    	                                message: '请填写菜单名称'
	    	                            }
	    	                        }
	    	                    },
	    	                     href: {
	    	                        validators: {
	    	                            notEmpty: {
	    	                                message: '请填写链接地址'
	    	                            }
	    	                        }
	    	                    }
	    	                }
	    	            });
	</script>